<script setup>
import {
  ref
} from 'vue'
import PageModel from '@/frame/view/page-model/index.vue'

/**
 * 页面基础
 */
const PageModelRef = ref()
const config = {
  url: "/api/Staff",
  method: "get",
  otherParams: {
    currentPage: 1,
    pageSize: 9999
  },
  header: {
    text: "员工列表",
    back: true
  },
  tab: {
    initData: undefined,
    prop: "isEnable",
    els: [
      {
        label: "全部",
        value: undefined
      },
      {
        label: "未启用",
        value: false
      },
      {
        label: "已启用",
        value: true
      }
    ]
  },
  search: {
    initData: "",
    prop: "name",
    placeholder: "员工名称"
  }
}
</script>

<template>
  <PageModel ref="PageModelRef" :config="config">
    <template #item="{item}">
      <view class="item">
        <view class="item-top">
          <view class="top-left">
            {{ item.name }}
          </view>
          <view class="item-right">
            {{ item.isEnable ? "已启用" : "未启用" }}
          </view>
        </view>
        <view class="item-content">
          部门名称：{{ item.departmentName }}
        </view>
        <view class="item-content">
          联系方式：{{ item.contact }}
        </view>
        <view class="item-content">
          创建时间：{{ item.createTime }}
        </view>
      </view>
    </template>
  </PageModel>
</template>

<style lang="scss" scoped src="./index.scss">
</style>